from fastapi import APIRouter
from src.api.models import ChatRequest, StandardResponse
from src.agent.chat import get_chat_response

router = APIRouter()


@router.post("/", response_model=StandardResponse[str])
async def chat(request: ChatRequest):
    response_text = get_chat_response(request.prompt)
    return StandardResponse(result=response_text)
